<div class="row">
     <div class="col-xs-12 col-xs-12">
          <div class="widget radius-bordered">
              <div class="widget-header bg-blue">
				<i class="widget-icon fa fa-arrow-down"></i>
				<span class="widget-caption">消息设置</span>
				<div class="widget-buttons">
					<a href="#" data-toggle="maximize">
						<i class="fa fa-expand"></i>
					</a>
					<a href="#" data-toggle="collapse">
						<i class="fa fa-minus"></i>
					</a>
					<a href="#" data-toggle="dispose">
						<i class="fa fa-times"></i>
					</a>
				</div>
			</div>
              <div class="widget-body">
                   <form id="JoelForm" action="" method="post" class="form-horizontal"
                                                  data-bv-message=""
                                                  data-bv-feedbackicons-valid="glyphicon glyphicon-ok"
                                                  data-bv-feedbackicons-invalid="glyphicon glyphicon-remove"
                                                  data-bv-feedbackicons-validating="glyphicon glyphicon-refresh">
                  <input type="hidden" name="id" value="{$cache.id}">
                  <div class="form-title">
                        <a href="{:U('Cms/Vip/message/')}" class="btn btn-primary" data-loader="Joel-loader" data-loadername="会员消息">
						<i class="fa fa-mail-reply"></i>返回
						</a>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">发布对象</label>
                        
                        <if condition="$cache.id neq ''"><div class="col-lg-2 control-label" style="text-align:center;"><if condition="$cache.userid neq '0'">{$cache.user_name}<else/>群发所有用户</if></div><else/><div class="col-lg-4"><input type="text" class="form-control" name="userid" placeholder="填写用户编号以“,”分隔，不填则群发所有用户" value="{$Think.request.pids}"></div></if>
                        
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">消息种类<sup>*</sup></label>
                        <div class="col-lg-4">
                        <select id="type_id" name="type_id">
							<foreach name="type" item="vo">
								<option value="{$key}" <eq name="key" value="$cache.type_id">selected</eq>>{$vo}</option>
							</foreach>
						</select>
                        </div>
                   </div>
                   
                   <div class="form-group" id="index-wrap">
                        <label class="col-lg-2 control-label">索引</label>
                        <div class="col-lg-4">
						<input type="text" class="form-control" name="index_id" placeholder="索引值" value="{$cache.index_id}">
                        </div>
                   </div>
                   <script>
                   $(function(){
                   		$("#type_id").change(function(){
                   			if($(this).val()=='7'){
                   				$('#index-wrap').show();
                   			}else{
                   				$('#index-wrap').hide();
                   			}
                   		})
                   		
                   		if($("#type_id").val()=='7'){
                   			$('#index-wrap').show();
                   		}else{
                   			$('#index-wrap').hide();
                   		}
                   		
                   })
                   </script>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">版本<sup>*</sup></label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="version" placeholder="必填"
                                                               data-bv-notempty="true"
                                                               data-bv-notempty-message="不能为空" value="<eq name='cache.version' value=''><php> echo date('Ymd'); </php><else/>{$cache.version}</eq>">
                        </div>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">消息标题</label>
                        <div class="col-lg-4">
                        <input type="text" class="form-control" name="title" placeholder="输入标题" value="{$cache.title}">
                        </div>
                   </div>
                   <div class="form-group">
                        <label class="col-lg-2 control-label">消息内容<sup>*</sup></label>
                        <div class="col-lg-4">
                        <textarea class="form-control" name="msg" rows="5" data-bv-notempty="true" data-bv-notempty-message="不能为空">{$cache.msg}</textarea>
                        </div>
                   </div>
						<div class="form-group">
                             <div class="col-lg-offset-2 col-lg-4">
                             <button class="btn btn-primary btn-lg" type="submit"  disabled="disabled">发送</button>&nbsp;&nbsp;&nbsp;&nbsp;
                             <button class="btn btn-palegreen btn-lg" type="reset">重填</button>
                        </div>
                    </div>
                   </form>
                </div>
        </div>
	</div>
     
</div>
<!--面包屑导航封装-->
<div id="tmpbread" style="display: none;">{$breadhtml}</div>
<script type="text/javascript">
	setBread($('#tmpbread').html());
</script>
<!--/面包屑导航封装-->
<!--表单验证与提交封装-->
<script type="text/javascript">
	$('#JoelForm').bootstrapValidator({
		submitHandler: function (validator, form, submitButton) {
           var tourl="{:U('Cms/Vip/messageSet')}";
			var data=$('#JoelForm').serialize();
			$.Joel.ajax('post',tourl,data,null);
			return false;
        },
	});
</script>
<!--/表单验证与提交封装-->